/*
 * @Author: xiaosihan 
 * @Date: 2024-08-28 09:39:01 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2024-08-28 09:47:41
 */

import { Points } from "three";
import MeshBase from "three-base/MeshBase";
import threeUtils from "three-base/threeUtils";

// 模型粒子效果
export default class ModelParticles extends MeshBase {

    constructor(url?: string) {
        super(url);
        this.init();
    }

    //粒子进度
    particlesProgrees = 0;
    setParticlesProgrees(particlesProgrees: number) {
        this.particlesProgrees = particlesProgrees;
    }

    // 粒子对象
    particles = (() => {
        const particles = new Points();
        this.add(particles);
        return particles;
    })();

    init() {


        //加载完成时
        this.addEventListener("loaded", () => {
            threeUtils.applyAllTranstion(this);
        });
    }

}